import java.util.Scanner;

public class Demo9 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str=sc.nextLine();
        for (int i = 0; i <str.length() ; i++) {
            char c=str.charAt(i);
            System.out.print(c+" ");
        }
        System.out.println();
        char[] chars=str.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            System.out.print(chars[i]+" ");
        }
    }

}
